package com.it;

import com.it.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AppForScope {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookDao bookDao1 = (BookDao) ctx.getBean("bookDao");
        BookDao bookDao2 = (BookDao) ctx.getBean("bookDao");
        System.out.println(bookDao1);
        // => com.it.dao.impl.BookDaoImpl@25bbe1b6
        System.out.println(bookDao2);
        // => com.it.dao.impl.BookDaoImpl@5702b3b1
    }
}
